package com.dymall.payment;


import com.dymall.common.config.DefaultFeignConfig;
import org.apache.commons.validator.routines.CreditCardValidator;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@SpringBootApplication(scanBasePackages = {"com.dymall.payment","com.dymall.common"})
@MapperScan("com.dymall.payment.mapper")
@EnableFeignClients(basePackages = "com.dymall.common.api", defaultConfiguration = DefaultFeignConfig.class)
// 注意配置defaultConfiguration
public class PaymentApplication {
    public static void main(String[] args) {
        SpringApplication.run(PaymentApplication.class, args);
    }

    // 配置信用卡验证器
    @Bean
    public CreditCardValidator creditCardValidator(){
        return new CreditCardValidator();
    }
}